# Contributor: Orhun Parmaksız <orhunparmaksiz@gmail.com>
# Maintainer: Orhun Parmaksız <orhunparmaksiz@gmail.com>
pkgname=cargo-modules
pkgver=0.12.0
pkgrel=0
pkgdesc="A cargo plugin for showing an overview of a crate's modules"
url="https://github.com/regexident/cargo-modules"
# s390x: FTBFS
arch="all !s390x"
license="MPL-2.0"
makedepends="
	cargo
	cargo-auditable
	"
subpackages="$pkgname-doc"
source="$pkgname-$pkgver.tar.gz::https://github.com/regexident/cargo-modules/archive/$pkgver.tar.gz"
options="net" # needed to fetch crates

prepare() {
	default_prepare

	cargo fetch --target="$CTARGET" --locked
}

build() {
	cargo auditable build --release --frozen
}

check() {
	cargo test --frozen --lib
}

package() {
	install -Dm 755 target/release/cargo-modules -t "$pkgdir"/usr/bin
	install -Dm 644 README.md -t "$pkgdir/usr/share/doc/$pkgname"
}

sha512sums="
3ac57ca493ba2e1e66e826629989173798b99b60ce1a446791addeff906fde10f1cb6e039c0e195bd6764e442c34c7aedd5b43ee738badae4d188813013dfcb3  cargo-modules-0.12.0.tar.gz
"
